package radio;
import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JTabbedPane;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.RowSpec;
import com.jgoodies.forms.factories.FormFactory;
import javax.swing.JTextField;
import javax.swing.JComboBox;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import javax.swing.JToggleButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import java.awt.Color;
import javax.swing.border.BevelBorder;
import javax.swing.table.DefaultTableModel;
import javax.swing.ScrollPaneConstants;
import java.awt.FlowLayout;
import javax.swing.JTree;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.JList;
import javax.swing.AbstractListModel;
import javax.swing.JTextArea;
import javax.swing.JPasswordField;


public class JanelaPrincipal extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JPanel contentPane;
	private JTextField text_NOME;
	private JTextField text_CPF;
	private JTextField text_IDADE;
	private JTextField text_QMC;
	private JTextField text_HOMS;
	private JTextField text_RENDA;
	private JTextField text_TITULO;
	private JTextField text_BANDA;
	private JTextField text_DURACAO;
	private JTextField text_NG;
	private JTextField text_PESO;
	private JTextField text_DECADA;
	private JTable tableClientes;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					JanelaPrincipal frame = new JanelaPrincipal();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public JanelaPrincipal() {
		setTitle("Radio Rock SWD");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 662, 357);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
		
		JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		JPanel panel = new JPanel();
		tabbedPane.add(panel, "Cadastrar Cliente");
		panel.setLayout(null);
		
		JLabel lblNome = new JLabel("NOME:");
		lblNome.setBounds(10, 9, 56, 14);
		panel.add(lblNome);
		
		text_NOME = new JTextField();
		text_NOME.setBounds(76, 6, 468, 20);
		panel.add(text_NOME);
		text_NOME.setColumns(10);
		
		JLabel lblCpf = new JLabel("CPF:");
		lblCpf.setBounds(10, 35, 56, 14);
		panel.add(lblCpf);
		
		text_CPF = new JTextField();
		text_CPF.setBounds(76, 32, 211, 20);
		panel.add(text_CPF);
		text_CPF.setColumns(10);
		
		JLabel lblIdade = new JLabel("IDADE:");
		lblIdade.setBounds(10, 61, 56, 14);
		panel.add(lblIdade);
		
		text_IDADE = new JTextField();
		text_IDADE.setBounds(76, 58, 84, 20);
		panel.add(text_IDADE);
		text_IDADE.setColumns(10);
		
		JLabel lblSexo = new JLabel("SEXO:");
		lblSexo.setBounds(297, 35, 56, 14);
		panel.add(lblSexo);
		
		JComboBox comboBox = new JComboBox();
		comboBox.setBounds(370, 32, 174, 20);
		comboBox.setModel(new DefaultComboBoxModel(new String[] {"MASCULINO", "FEMININO"}));
		panel.add(comboBox);
		
		JLabel lblQuantMusicasCompradas = new JLabel("QUANT. MUSICAS COMPRADAS:");
		lblQuantMusicasCompradas.setBounds(10, 113, 217, 14);
		panel.add(lblQuantMusicasCompradas);
		
		text_QMC = new JTextField();
		text_QMC.setBounds(237, 110, 100, 20);
		panel.add(text_QMC);
		text_QMC.setColumns(3);
		
		JLabel lblHsOuvindoMusica = new JLabel("HS OUVINDO MUSICA:");
		lblHsOuvindoMusica.setBounds(10, 139, 167, 14);
		panel.add(lblHsOuvindoMusica);
		
		text_HOMS = new JTextField();
		text_HOMS.setBounds(237, 136, 100, 20);
		panel.add(text_HOMS);
		text_HOMS.setColumns(10);
		
		JLabel lblRendarMensal = new JLabel("RENDA (R$) MENSAL:");
		lblRendarMensal.setBounds(10, 164, 167, 20);
		panel.add(lblRendarMensal);
		
		text_RENDA = new JTextField();
		text_RENDA.setBounds(237, 167, 100, 20);
		panel.add(text_RENDA);
		text_RENDA.setColumns(10);
		
		JButton btnCadastrar = new JButton("CADASTRAR");
		btnCadastrar.setBounds(370, 109, 174, 23);
		panel.add(btnCadastrar);
		
		JButton btnBuscarPeloCpf = new JButton("BUSCAR PELO CPF");
		btnBuscarPeloCpf.setBounds(370, 142, 174, 23);
		panel.add(btnBuscarPeloCpf);
		
		JButton btnExcluirCliente = new JButton("EXCLUIR");
		btnExcluirCliente.setBounds(370, 176, 174, 23);
		panel.add(btnExcluirCliente);
		JPanel panel_1 = new JPanel();
		tabbedPane.add(panel_1, "Cadastrar Musica");
		panel_1.setLayout(null);
		
		JLabel lblTitulo = new JLabel("TITULO:");
		lblTitulo.setBounds(48, 33, 100, 14);
		panel_1.add(lblTitulo);
		
		text_TITULO = new JTextField();
		text_TITULO.setBounds(119, 30, 271, 20);
		panel_1.add(text_TITULO);
		text_TITULO.setColumns(10);
		
		JLabel lblBanda = new JLabel("BANDA:");
		lblBanda.setBounds(50, 58, 98, 14);
		panel_1.add(lblBanda);
		
		text_BANDA = new JTextField();
		text_BANDA.setBounds(119, 55, 271, 20);
		panel_1.add(text_BANDA);
		text_BANDA.setColumns(10);
		
		JLabel lblDurao = new JLabel("DURA\u00C7\u00C3O:");
		lblDurao.setBounds(34, 83, 114, 14);
		panel_1.add(lblDurao);
		
		text_DURACAO = new JTextField();
		text_DURACAO.setBounds(119, 80, 75, 20);
		panel_1.add(text_DURACAO);
		text_DURACAO.setColumns(10);
		
		JLabel lblNGuitars = new JLabel("N. GUITARS");
		lblNGuitars.setBounds(30, 108, 118, 14);
		panel_1.add(lblNGuitars);
		
		text_NG = new JTextField();
		text_NG.setBounds(119, 105, 75, 20);
		panel_1.add(text_NG);
		text_NG.setColumns(10);
		
		JLabel lblPeso = new JLabel("PESO:");
		lblPeso.setBounds(58, 133, 90, 14);
		panel_1.add(lblPeso);
		
		text_PESO = new JTextField();
		text_PESO.setBounds(119, 130, 75, 20);
		panel_1.add(text_PESO);
		text_PESO.setColumns(10);
		
		JLabel lblDcada = new JLabel("D\u00C9CADA:");
		lblDcada.setBounds(43, 158, 105, 14);
		panel_1.add(lblDcada);
		
		text_DECADA = new JTextField();
		text_DECADA.setBounds(119, 155, 75, 20);
		panel_1.add(text_DECADA);
		text_DECADA.setColumns(10);
		
		JButton btnCadastrarMusica = new JButton("Cadastrar");
		btnCadastrarMusica.setBounds(420, 29, 189, 23);
		btnCadastrarMusica.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});
		panel_1.add(btnCadastrarMusica);
		
		JButton btnBuscarTitulo = new JButton("Busca Pelo Titulo");
		btnBuscarTitulo.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});
		btnBuscarTitulo.setBounds(420, 58, 189, 23);
		panel_1.add(btnBuscarTitulo);
		
		JButton btnExcluirMusica = new JButton("EXCLUIR");
		btnExcluirMusica.setBounds(420, 99, 189, 23);
		panel_1.add(btnExcluirMusica);
		JPanel panel_2 = new JPanel();
		tabbedPane.add(panel_2, "Lista de Clientes");
		panel_2.setLayout(null);
		
		JScrollPane scrollPane = new JScrollPane();
		scrollPane.setBounds(0, 0, 626, 234);
		panel_2.add(scrollPane);
		
		tableClientes = new JTable();
		tableClientes.setModel(new DefaultTableModel(
			new Object[][] {
			},
			new String[] {
				"NOME", "CPF", "IDADE", "SEXO", "RENDA", "QMC", "HOMS"
			}
		) {
			/**
			 * 
			 */
			private static final long serialVersionUID = 1L;
			boolean[] columnEditables = new boolean[] {
				false, false, false, false, false, false, false
			};
			public boolean isCellEditable(int row, int column) {
				return columnEditables[column];
			}
		});
		scrollPane.setViewportView(tableClientes);
		
		JButton btnCarregarLista = new JButton("Carregar Lista");
		btnCarregarLista.setBounds(10, 246, 116, 23);
		panel_2.add(btnCarregarLista);
		JPanel panel_3 = new JPanel();
		tabbedPane.add(panel_3, "Lista de Musicas");
		panel_3.setLayout(null);
		
		JScrollPane scrollPane_Musica = new JScrollPane();
		scrollPane_Musica.setBounds(0, 277, 621, -277);
		panel_3.add(scrollPane_Musica);
		
		JTree tree = new JTree();
		tree.setBounds(10, 11, 307, 255);
		tree.setModel(new DefaultTreeModel(
			new DefaultMutableTreeNode("Within Temptation") {
				{
					add(new DefaultMutableTreeNode("Frozen"));
				}
			}
		));
		panel_3.add(tree);
		JPanel panel_4 = new JPanel();
		tabbedPane.add(panel_4, "AVALIACAO");
		panel_4.setLayout(null);
		
		JList list = new JList();
		list.setBounds(157, 55, 1, 1);
		panel_4.add(list);
		
		
		
		contentPane.add(tabbedPane, BorderLayout.CENTER);
	}
}
